<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductVariantsInGrid.ascx.cs"
    Inherits="Tathata.Web.Modules.Products.ProductVariantsInGridControl" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="~/Modules/SimpleTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="~/Modules/NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ProductAttributes" Src="~/Modules/Products/ProductAttributes.ascx" %>
<%@ Reference Control="~/Modules/Products/ProductAttributes.ascx" %>
<%@ Reference Control="~/Modules/EmailTextBox.ascx" %>
<asp:Repeater ID="rptVariants" runat="server" OnItemCommand="rptVariants_OnItemCommand"
    OnItemDataBound="rptVariants_OnItemDataBound">
    <ItemTemplate>
        <table cellspacing="0" cellpadding="0" border="0" class="productAddInfo1">
            <tbody>
                <tr>
                    <td colspan="2">
                        <table>
                            <tr>
                                <td>
                                    <asp:Image ID="iProductVariantPicture" runat="server" />
                                </td>
                                <td>
                                    <em>
                                        <%#Server.HtmlEncode(Eval("Name").ToString())%>
                                    </em>
                                    <asp:Label runat="server" ID="lblError" EnableViewState="false" Style="color: Red;"></asp:Label>
                                    <asp:Label runat="server" ID="ProductVariantID" Text='<%#Eval("ProductVariantID")%>'
                                        Visible="false"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server" visible='<%# !String.IsNullOrEmpty(Eval("Description").ToString()) %>'>
                    <td colspan="2">
                        <table>
                            <tr>
                                <td>
                                    <%# Eval("Description")%>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server" visible='<%#Eval("RequiresTextOption") %>'>
                    <td colspan="2">
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblTextOptionPrompt" runat="server"></asp:Label>
                                    <nopCommerce:SimpleTextBox runat="server" ID="txtTextOption"></nopCommerce:SimpleTextBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="pnlAttributes" runat="server">
                    <td colspan="2">
                        <nopCommerce:ProductAttributes ID="ctrlProductAttributes" runat="server" ProductVariantID='<%#Eval("ProductVariantID") %>'>
                        </nopCommerce:ProductAttributes>
                    </td>
                </tr>
                <tr>
                    <td valign="middle" align="left">
                        <table>
                            <tr>
                                <td>
                                    <s>
                                        <asp:Label ID="lblOldPrice" runat="server" />
                                    </s>
                                    <asp:Label ID="lblPrice" runat="server" CssClass="productPrice" />
                                    <br />
                                    <asp:Label ID="lblDiscount" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td valign="middle" align="left">
                        <nopCommerce:NumericTextBox runat="server" ID="txtQuantity" Value="1" RequiredErrorMessage="Enter quantity"
                            RangeErrorMessage="The value must be from 1 to 9999" MinimumValue="1" MaximumValue="9999"
                            Width="50"></nopCommerce:NumericTextBox>
                        <asp:Button ID="btnAddToCart" runat="server" Text="Add to cart" CommandName="AddToCart"
                            CommandArgument='<%#Eval("ProductVariantID")%>'></asp:Button>
                        <asp:Button ID="btnAddToWishlist" runat="server" Text="Add to wishlist" CommandName="AddToWishlist"
                            CommandArgument='<%#Eval("ProductVariantID")%>'></asp:Button>
                    </td>
                </tr>
            </tbody>
        </table>
    </ItemTemplate>
    <HeaderTemplate>
        <br style="line-height: 16px;" />
    </HeaderTemplate>
    <SeparatorTemplate>
        <br style="line-height: 16px;" />
    </SeparatorTemplate>
    <FooterTemplate>
        <br style="line-height: 16px;" />
    </FooterTemplate>
</asp:Repeater>
